package cn.meye11.crm.domain.model;

import cn.meye11.crm.domain.entity.CostEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
 * (Cost)模型类
 *
 * @author makejava
 * @since 2024-01-03 14:41:34
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Cost implements Serializable {

    private static final long serialVersionUID = 156330320684488489L;
    
    public Cost(CostEntity entity) {
        BeanUtils.copyProperties(entity, this);
    }
    
    private Long id;
    /* 成本年月 */
    private String yearmonth;
   // @ApiModelProperty(value = "成本项目")
    @NotEmpty(message = "成本项目 不能为空")
    private String name;
   // @ApiModelProperty(value = "成本价")
    @NotNull(message = "成本价 不能为空")
    private Double costPrice;
   // @ApiModelProperty(value = "操作人姓名")
    private String operators;
   // @ApiModelProperty(value = "标签")
    private String label;
   // @ApiModelProperty(value = "是否删除", hidden = true)
    private Integer del;
   // @ApiModelProperty(value = "最后修改时间", notes = "yyyy-MM-dd HH:mm:ss", example = "2020-01-01 00:00:00", hidden = true)
    private LocalDateTime last;
   // @ApiModelProperty(value = "创建时间", notes = "yyyy-MM-dd HH:mm:ss", example = "2020-01-01 00:00:00", hidden = true)
    private LocalDateTime time;
   // @ApiModelProperty(value = "创建人", hidden = true)
    private String createdBy;
   // @ApiModelProperty(value = "最后修改人", hidden = true)
    private String modifiedBy;
   // @ApiModelProperty(value = "版本")
    private Integer version;

}
